package com.hoozhi.education.dao.impl;

import java.util.List;

import com.hoozhi.common.web.hibernate.HibernateSimpleDao;
import com.hoozhi.education.dao.EduGroupDao;
import com.hoozhi.education.entity.EduGroup;

/**
 * 用户组管理模块DAO层实现类
 * @author pharen
 *
 */
public class EduGroupDaoImpl extends HibernateSimpleDao<EduGroup, Long> implements EduGroupDao {

	@Override
	public EduGroup findById(Integer gid) {
		return getHibernateTemplate().get(EduGroup.class, gid);
	}

	@Override
	public List<EduGroup> fingAll() {
		return createQuery("from EduGroup");
	}

	@Override
	public EduGroup save(EduGroup group) {
		getHibernateTemplate().save(group);
		return group;
	}

	@Override
	public EduGroup update(EduGroup group) {
		getHibernateTemplate().update(group);
		return group;
	}

	@Override
	public void delete(EduGroup group) {
		getHibernateTemplate().delete(group);
	}

	@Override
	public void deleteById(Integer gid) {
		EduGroup group = findById(gid);
		getHibernateTemplate().delete(group);
	}
}
